package com.qianclass.talklive.app.im;
public class Packet {
	public        byte[]          data      = null;
	public        int             len       = 0;
	public        PacketHead      head      = null;
	public        InPacket  in        = null;
	public        OutPacket out       = null;
	public static int             packet_id = 0;	// 自增

	public Packet(PacketHead paraHead, OutPacket paraOut)
	{
		head = paraHead;
		out = paraOut;
		len = paraHead.headLen + paraOut.nPayloadLen;
		data = new byte[len];
		System.arraycopy(paraHead.head, 0, data, 0, paraHead.headLen);
		System.arraycopy(paraOut.bytePayload, 0, data, paraHead.headLen, paraOut.nPayloadLen);
	}
	public Packet(PacketHead paraHead, InPacket paraIn)
	{
		head = paraHead;
		in = paraIn;
		len = paraHead.headLen + paraIn.nPayloadLen;
		data = new byte[len];
		System.arraycopy(paraHead.head, 0, data, 0, paraHead.headLen);
		System.arraycopy(paraIn.bytePayload, 0, data, paraHead.headLen, paraIn.nPayloadLen);
	}
}
